package com.lisp.clp.child_first;

import java.net.URL;

import com.lisp.clp.box.IBox;

public class ChildFirstTestJCL2 {
	public static void main(String[] args) throws Exception {
		ChildFirstClassLoader childClassLoader = new ChildFirstClassLoader(
	        new URL[] {
	          new URL("file:lib/log4j-1.2.17.jar"),
	          new URL("file:lib/"),           // 用于加载log4j.xml
	          new URL("file:target/classes/") // 用于加载com.lisp.clp.box.impl.BoxImplWithJCL
        });
		
		Thread.currentThread().setContextClassLoader(childClassLoader);

	    Class<?> boxClass = childClassLoader.loadClass("com.lisp.clp.box.impl.BoxImplWithJCL");
	    IBox box = (IBox) boxClass.newInstance();
	    box.print();
	}
}
